/* For the RP 1968,75,82,90,99,07,12 */
/* Extract and combine (when necessary) variables from the database */
/* Also keep a 10% sample of the original file */

/* Librairies finales */
libname tbrp "P:\Donnees\TbRP";
libname mini "P:\Donnees\TbRP\mini";

/********************/
/* Recensement 1968 */
/********************/
libname table   'S:\RP\RP 1968\Exploitation compl�mentaire\tables sas\individu' ;
libname famille 'S:\RP\RP 1968\Exploitation compl�mentaire\tables sas\famille';
libname ilot "S:\RP\RP 1968\Exploitation compl�mentaire\tables sas\ilot";
libname logmt "S:\RP\RP 1968\Exploitation compl�mentaire\tables sas\logement";

options ls=80 mprint ;

/* individu */
Data indiv;
length identilot $8;
length ilot $3;
length depcom $5;
length d $2;
length c $3;
length identind $40;
set 
table.individu01 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr)

table.individu02 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr)
table.individu03 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu04 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu05 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu06 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu07 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu08 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu09 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu10 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu11 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu12 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu13 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu14 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu15 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu16 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu17 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu18 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu19 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu20 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu21 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu22 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu23 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu24 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu25 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu26 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu27 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu28 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu29 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu30 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu31 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu32 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu33 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu34 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu35 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu36 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu37 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu38 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu39 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu40 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu41 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu42 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu43 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu44 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu45 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu46 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu47 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu48 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu49 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu50 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu51 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu52 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu53 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu54 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu55 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu56 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu57 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu58 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu59 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu60 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu61 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu62 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu63 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu64 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu65 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu66 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu67 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu68 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu69 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu70 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu71 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu72 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu73 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu74 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu75 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu76 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu77 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu78 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu79 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu80 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu81 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu82 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu83 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu84 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu85 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu86 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu87 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu88 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu89 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu90 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu91 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu92 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu93 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu94 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )
table.individu95 (keep = identind depcom ilot in pn cm1 csd ad cs3 s m ta dip ae ai cs3 s m ta dip   lcm  lcf cae3 af pr )

;
identilot=depcom||ilot;
d=substr(depcom,1,2);
c=substr(depcom,3,3);
sond=4;
run;

data indiv;
set indiv;
/* length identilot $8;*/
length nind $5 nfam $5 nlog $5 nlog2 $5 ; 
/* identilot=substr(identind,1,8); */
nind=scan(identind,2,'ind');
nfam=scan(identind,2,'fam');
nfam=scan(nfam,1,'ind');
nlog=scan(identind,2,'log');
nlog=scan(nlog,1,'ind');
nlog2=scan(nlog,1,'fam');
if not(missing(nlog2)) then nlog=nlog2;
drop nlog2;
run;
proc sort data=indiv;
by identilot nlog nfam nind ;
run;

/* famille */
Data famille;
length identfam $30;
set 
famille.famille01 (keep = identfam lcmf pcf nef)

famille.famille02 (keep = identfam lcmf pcf nef)
famille.famille03 (keep = identfam lcmf pcf nef)
famille.famille04 (keep = identfam lcmf pcf nef)
famille.famille05 (keep = identfam lcmf pcf nef)
famille.famille06 (keep = identfam lcmf pcf nef)
famille.famille07 (keep = identfam lcmf pcf nef)
famille.famille08 (keep = identfam lcmf pcf nef)
famille.famille09 (keep = identfam lcmf pcf nef)
famille.famille10 (keep = identfam lcmf pcf nef)
famille.famille11 (keep = identfam lcmf pcf nef)
famille.famille12 (keep = identfam lcmf pcf nef)
famille.famille13 (keep = identfam lcmf pcf nef)
famille.famille14 (keep = identfam lcmf pcf nef)
famille.famille15 (keep = identfam lcmf pcf nef)
famille.famille16 (keep = identfam lcmf pcf nef)
famille.famille17 (keep = identfam lcmf pcf nef)
famille.famille18 (keep = identfam lcmf pcf nef)
famille.famille19 (keep = identfam lcmf pcf nef)
famille.famille20 (keep = identfam lcmf pcf nef)
famille.famille21 (keep = identfam lcmf pcf nef)
famille.famille22 (keep = identfam lcmf pcf nef)
famille.famille23 (keep = identfam lcmf pcf nef)
famille.famille24 (keep = identfam lcmf pcf nef)
famille.famille25 (keep = identfam lcmf pcf nef)
famille.famille26 (keep = identfam lcmf pcf nef)
famille.famille27 (keep = identfam lcmf pcf nef)
famille.famille28 (keep = identfam lcmf pcf nef)
famille.famille29 (keep = identfam lcmf pcf nef)
famille.famille30 (keep = identfam lcmf pcf nef)
famille.famille31 (keep = identfam lcmf pcf nef)
famille.famille32 (keep = identfam lcmf pcf nef)
famille.famille33 (keep = identfam lcmf pcf nef)
famille.famille34 (keep = identfam lcmf pcf nef)
famille.famille35 (keep = identfam lcmf pcf nef)
famille.famille36 (keep = identfam lcmf pcf nef)
famille.famille37 (keep = identfam lcmf pcf nef)
famille.famille38 (keep = identfam lcmf pcf nef)
famille.famille39 (keep = identfam lcmf pcf nef)
famille.famille40 (keep = identfam lcmf pcf nef)
famille.famille41 (keep = identfam lcmf pcf nef)
famille.famille42 (keep = identfam lcmf pcf nef)
famille.famille43 (keep = identfam lcmf pcf nef)
famille.famille44 (keep = identfam lcmf pcf nef)
famille.famille45 (keep = identfam lcmf pcf nef)
famille.famille46 (keep = identfam lcmf pcf nef)
famille.famille47 (keep = identfam lcmf pcf nef)
famille.famille48 (keep = identfam lcmf pcf nef)
famille.famille49 (keep = identfam lcmf pcf nef)
famille.famille50 (keep = identfam lcmf pcf nef)
famille.famille51 (keep = identfam lcmf pcf nef)
famille.famille52 (keep = identfam lcmf pcf nef)
famille.famille53 (keep = identfam lcmf pcf nef)
famille.famille54 (keep = identfam lcmf pcf nef)
famille.famille55 (keep = identfam lcmf pcf nef)
famille.famille56 (keep = identfam lcmf pcf nef)
famille.famille57 (keep = identfam lcmf pcf nef)
famille.famille58 (keep = identfam lcmf pcf nef)
famille.famille59 (keep = identfam lcmf pcf nef)
famille.famille60 (keep = identfam lcmf pcf nef)
famille.famille61 (keep = identfam lcmf pcf nef)
famille.famille62 (keep = identfam lcmf pcf nef)
famille.famille63 (keep = identfam lcmf pcf nef)
famille.famille64 (keep = identfam lcmf pcf nef)
famille.famille65 (keep = identfam lcmf pcf nef)
famille.famille66 (keep = identfam lcmf pcf nef)
famille.famille67 (keep = identfam lcmf pcf nef)
famille.famille68 (keep = identfam lcmf pcf nef)
famille.famille69 (keep = identfam lcmf pcf nef)
famille.famille70 (keep = identfam lcmf pcf nef)
famille.famille71 (keep = identfam lcmf pcf nef)
famille.famille72 (keep = identfam lcmf pcf nef)
famille.famille73 (keep = identfam lcmf pcf nef)
famille.famille74 (keep = identfam lcmf pcf nef)
famille.famille75 (keep = identfam lcmf pcf nef)
famille.famille76 (keep = identfam lcmf pcf nef)
famille.famille77 (keep = identfam lcmf pcf nef)
famille.famille78 (keep = identfam lcmf pcf nef)
famille.famille79 (keep = identfam lcmf pcf nef)
famille.famille80 (keep = identfam lcmf pcf nef)
famille.famille81 (keep = identfam lcmf pcf nef)
famille.famille82 (keep = identfam lcmf pcf nef)
famille.famille83 (keep = identfam lcmf pcf nef)
famille.famille84 (keep = identfam lcmf pcf nef)
famille.famille85 (keep = identfam lcmf pcf nef)
famille.famille86 (keep = identfam lcmf pcf nef)
famille.famille87 (keep = identfam lcmf pcf nef)
famille.famille88 (keep = identfam lcmf pcf nef)
famille.famille89 (keep = identfam lcmf pcf nef)
famille.famille90 (keep = identfam lcmf pcf nef)
famille.famille91 (keep = identfam lcmf pcf nef)
famille.famille92 (keep = identfam lcmf pcf nef)
famille.famille93 (keep = identfam lcmf pcf nef)
famille.famille94 (keep = identfam lcmf pcf nef)
famille.famille95 (keep = identfam lcmf pcf nef)

;
run;

data famille;
set famille;
 length identilot $8;
length nfam $5 nlog $5 nlog2 $5 ; 
identilot=substr(identfam,1,8);
nfam=scan(identfam,2,'fam');
nfam=scan(nfam,1,'ind');
nlog=scan(identfam,2,'log');
nlog=scan(nlog,1,'ind');
nlog2=scan(nlog,1,'fam');
if not(missing(nlog2)) then nlog=nlog2;
drop nlog2;
run;
proc sort data=famille;
by identilot nlog nfam ;
run;

/************************/
/* individu x famille   */
/************************/
data table;
merge indiv (in = x) famille ;
by identilot nlog nfam;
if x;
run;

/* logement */
Data logement;
length identlog $20;
set 
logmt.logement01 (keep = identlog nim ip aac3)

logmt.logement02 (keep = identlog nim ip aac3)
logmt.logement03 (keep = identlog nim ip aac3)
logmt.logement04 (keep = identlog nim ip aac3)
logmt.logement05 (keep = identlog nim ip aac3)
logmt.logement06 (keep = identlog nim ip aac3)
logmt.logement07 (keep = identlog nim ip aac3)
logmt.logement08 (keep = identlog nim ip aac3)
logmt.logement09 (keep = identlog nim ip aac3)
logmt.logement10 (keep = identlog nim ip aac3)
logmt.logement11 (keep = identlog nim ip aac3)
logmt.logement12 (keep = identlog nim ip aac3)
logmt.logement13 (keep = identlog nim ip aac3)
logmt.logement14 (keep = identlog nim ip aac3)
logmt.logement15 (keep = identlog nim ip aac3)
logmt.logement16 (keep = identlog nim ip aac3)
logmt.logement17 (keep = identlog nim ip aac3)
logmt.logement18 (keep = identlog nim ip aac3)
logmt.logement19 (keep = identlog nim ip aac3)
logmt.logement20 (keep = identlog nim ip aac3)
logmt.logement21 (keep = identlog nim ip aac3)
logmt.logement22 (keep = identlog nim ip aac3)
logmt.logement23 (keep = identlog nim ip aac3)
logmt.logement24 (keep = identlog nim ip aac3)
logmt.logement25 (keep = identlog nim ip aac3)
logmt.logement26 (keep = identlog nim ip aac3)
logmt.logement27 (keep = identlog nim ip aac3)
logmt.logement28 (keep = identlog nim ip aac3)
logmt.logement29 (keep = identlog nim ip aac3)
logmt.logement30 (keep = identlog nim ip aac3)
logmt.logement31 (keep = identlog nim ip aac3)
logmt.logement32 (keep = identlog nim ip aac3)
logmt.logement33 (keep = identlog nim ip aac3)
logmt.logement34 (keep = identlog nim ip aac3)
logmt.logement35 (keep = identlog nim ip aac3)
logmt.logement36 (keep = identlog nim ip aac3)
logmt.logement37 (keep = identlog nim ip aac3)
logmt.logement38 (keep = identlog nim ip aac3)
logmt.logement39 (keep = identlog nim ip aac3)
logmt.logement40 (keep = identlog nim ip aac3)
logmt.logement41 (keep = identlog nim ip aac3)
logmt.logement42 (keep = identlog nim ip aac3)
logmt.logement43 (keep = identlog nim ip aac3)
logmt.logement44 (keep = identlog nim ip aac3)
logmt.logement45 (keep = identlog nim ip aac3)
logmt.logement46 (keep = identlog nim ip aac3)
logmt.logement47 (keep = identlog nim ip aac3)
logmt.logement48 (keep = identlog nim ip aac3)
logmt.logement49 (keep = identlog nim ip aac3)
logmt.logement50 (keep = identlog nim ip aac3)
logmt.logement51 (keep = identlog nim ip aac3)
logmt.logement52 (keep = identlog nim ip aac3)
logmt.logement53 (keep = identlog nim ip aac3)
logmt.logement54 (keep = identlog nim ip aac3)
logmt.logement55 (keep = identlog nim ip aac3)
logmt.logement56 (keep = identlog nim ip aac3)
logmt.logement57 (keep = identlog nim ip aac3)
logmt.logement58 (keep = identlog nim ip aac3)
logmt.logement59 (keep = identlog nim ip aac3)
logmt.logement60 (keep = identlog nim ip aac3)
logmt.logement61 (keep = identlog nim ip aac3)
logmt.logement62 (keep = identlog nim ip aac3)
logmt.logement63 (keep = identlog nim ip aac3)
logmt.logement64 (keep = identlog nim ip aac3)
logmt.logement65 (keep = identlog nim ip aac3)
logmt.logement66 (keep = identlog nim ip aac3)
logmt.logement67 (keep = identlog nim ip aac3)
logmt.logement68 (keep = identlog nim ip aac3)
logmt.logement69 (keep = identlog nim ip aac3)
logmt.logement70 (keep = identlog nim ip aac3)
logmt.logement71 (keep = identlog nim ip aac3)
logmt.logement72 (keep = identlog nim ip aac3)
logmt.logement73 (keep = identlog nim ip aac3)
logmt.logement74 (keep = identlog nim ip aac3)
logmt.logement75 (keep = identlog nim ip aac3)
logmt.logement76 (keep = identlog nim ip aac3)
logmt.logement77 (keep = identlog nim ip aac3)
logmt.logement78 (keep = identlog nim ip aac3)
logmt.logement79 (keep = identlog nim ip aac3)
logmt.logement80 (keep = identlog nim ip aac3)
logmt.logement81 (keep = identlog nim ip aac3)
logmt.logement82 (keep = identlog nim ip aac3)
logmt.logement83 (keep = identlog nim ip aac3)
logmt.logement84 (keep = identlog nim ip aac3)
logmt.logement85 (keep = identlog nim ip aac3)
logmt.logement86 (keep = identlog nim ip aac3)
logmt.logement87 (keep = identlog nim ip aac3)
logmt.logement88 (keep = identlog nim ip aac3)
logmt.logement89 (keep = identlog nim ip aac3)
logmt.logement90 (keep = identlog nim ip aac3)
logmt.logement91 (keep = identlog nim ip aac3)
logmt.logement92 (keep = identlog nim ip aac3)
logmt.logement93 (keep = identlog nim ip aac3)
logmt.logement94 (keep = identlog nim ip aac3)
logmt.logement95 (keep = identlog nim ip aac3)

;
run;
data logement;
set logement;
length identilot $8;
length nlog $5 nlog2 $5 ; 
identilot=substr(identlog,1,8);
nlog=scan(identlog,2,'log');
nlog=scan(nlog,1,'ind');
nlog2=scan(nlog,1,'fam');
if not(missing(nlog2)) then nlog=nlog2;
drop nlog2;
run;

proc sort data=logement;
by identilot nlog;
run;

proc sort data=table;
by identilot nlog;
run;

/************************/
/* individu x logement  */
/************************/
data table;
merge table (in = x) logement ;
by identilot nlog;
if x;
run;

/* ilot */
data ilot;
length qu $2;
set 
ilot.ilot01 (keep = il qu diq tu u identilot )

ilot.ilot02 (keep = il qu diq tu u identilot )
ilot.ilot03 (keep = il qu diq tu u identilot )
ilot.ilot04 (keep = il qu diq tu u identilot )
ilot.ilot05 (keep = il qu diq tu u identilot )
ilot.ilot06 (keep = il qu diq tu u identilot )
ilot.ilot07 (keep = il qu diq tu u identilot )
ilot.ilot08 (keep = il qu diq tu u identilot )
ilot.ilot09 (keep = il qu diq tu u identilot )
ilot.ilot10 (keep = il qu diq tu u identilot )
ilot.ilot11 (keep = il qu diq tu u identilot )
ilot.ilot12 (keep = il qu diq tu u identilot )
ilot.ilot13 (keep = il qu diq tu u identilot )
ilot.ilot14 (keep = il qu diq tu u identilot )
ilot.ilot15 (keep = il qu diq tu u identilot )
ilot.ilot16 (keep = il qu diq tu u identilot )
ilot.ilot17 (keep = il qu diq tu u identilot )
ilot.ilot18 (keep = il qu diq tu u identilot )
ilot.ilot19 (keep = il qu diq tu u identilot )
ilot.ilot20 (keep = il qu diq tu u identilot )
ilot.ilot21 (keep = il qu diq tu u identilot )
ilot.ilot22 (keep = il qu diq tu u identilot )
ilot.ilot23 (keep = il qu diq tu u identilot )
ilot.ilot24 (keep = il qu diq tu u identilot )
ilot.ilot25 (keep = il qu diq tu u identilot )
ilot.ilot26 (keep = il qu diq tu u identilot )
ilot.ilot27 (keep = il qu diq tu u identilot )
ilot.ilot28 (keep = il qu diq tu u identilot )
ilot.ilot29 (keep = il qu diq tu u identilot )
ilot.ilot30 (keep = il qu diq tu u identilot )
ilot.ilot31 (keep = il qu diq tu u identilot )
ilot.ilot32 (keep = il qu diq tu u identilot )
ilot.ilot33 (keep = il qu diq tu u identilot )
ilot.ilot34 (keep = il qu diq tu u identilot )
ilot.ilot35 (keep = il qu diq tu u identilot )
ilot.ilot36 (keep = il qu diq tu u identilot )
ilot.ilot37 (keep = il qu diq tu u identilot )
ilot.ilot38 (keep = il qu diq tu u identilot )
ilot.ilot39 (keep = il qu diq tu u identilot )
ilot.ilot40 (keep = il qu diq tu u identilot )
ilot.ilot41 (keep = il qu diq tu u identilot )
ilot.ilot42 (keep = il qu diq tu u identilot )
ilot.ilot43 (keep = il qu diq tu u identilot )
ilot.ilot44 (keep = il qu diq tu u identilot )
ilot.ilot45 (keep = il qu diq tu u identilot )
ilot.ilot46 (keep = il qu diq tu u identilot )
ilot.ilot47 (keep = il qu diq tu u identilot )
ilot.ilot48 (keep = il qu diq tu u identilot )
ilot.ilot49 (keep = il qu diq tu u identilot )
ilot.ilot50 (keep = il qu diq tu u identilot )
ilot.ilot51 (keep = il qu diq tu u identilot )
ilot.ilot52 (keep = il qu diq tu u identilot )
ilot.ilot53 (keep = il qu diq tu u identilot )
ilot.ilot54 (keep = il qu diq tu u identilot )
ilot.ilot55 (keep = il qu diq tu u identilot )
ilot.ilot56 (keep = il qu diq tu u identilot )
ilot.ilot57 (keep = il qu diq tu u identilot )
ilot.ilot58 (keep = il qu diq tu u identilot )
ilot.ilot59 (keep = il qu diq tu u identilot )
ilot.ilot60 (keep = il qu diq tu u identilot )
ilot.ilot61 (keep = il qu diq tu u identilot )
ilot.ilot62 (keep = il qu diq tu u identilot )
ilot.ilot63 (keep = il qu diq tu u identilot )
ilot.ilot64 (keep = il qu diq tu u identilot )
ilot.ilot65 (keep = il qu diq tu u identilot )
ilot.ilot66 (keep = il qu diq tu u identilot )
ilot.ilot67 (keep = il qu diq tu u identilot )
ilot.ilot68 (keep = il qu diq tu u identilot )
ilot.ilot69 (keep = il qu diq tu u identilot )
ilot.ilot70 (keep = il qu diq tu u identilot )
ilot.ilot71 (keep = il qu diq tu u identilot )
ilot.ilot72 (keep = il qu diq tu u identilot )
ilot.ilot73 (keep = il qu diq tu u identilot )
ilot.ilot74 (keep = il qu diq tu u identilot )
ilot.ilot75 (keep = il qu diq tu u identilot )
ilot.ilot76 (keep = il qu diq tu u identilot )
ilot.ilot77 (keep = il qu diq tu u identilot )
ilot.ilot78 (keep = il qu diq tu u identilot )
ilot.ilot79 (keep = il qu diq tu u identilot )
ilot.ilot80 (keep = il qu diq tu u identilot )
ilot.ilot81 (keep = il qu diq tu u identilot )
ilot.ilot82 (keep = il qu diq tu u identilot )
ilot.ilot83 (keep = il qu diq tu u identilot )
ilot.ilot84 (keep = il qu diq tu u identilot )
ilot.ilot85 (keep = il qu diq tu u identilot )
ilot.ilot86 (keep = il qu diq tu u identilot )
ilot.ilot87 (keep = il qu diq tu u identilot )
ilot.ilot88 (keep = il qu diq tu u identilot )
ilot.ilot89 (keep = il qu diq tu u identilot )
ilot.ilot90 (keep = il qu diq tu u identilot )
ilot.ilot91 (keep = il qu diq tu u identilot )
ilot.ilot92 (keep = il qu diq tu u identilot )
ilot.ilot93 (keep = il qu diq tu u identilot )
ilot.ilot94 (keep = il qu diq tu u identilot )
ilot.ilot95 (keep = il qu diq tu u identilot )

;
run;

/* individu x ilot */
proc sort data=indiv;
by identilot;
run;
proc sort data=ilot;
by identilot;
run;
data table(compress= yes);
merge table (in =x )ilot;
by identilot;
if x;
run;

data mini.rp68 (compress= yes);
set table;
y=ranbin(3,1,0.01);
if y=0 then delete;
drop y;
sond=sond*100;
run;

data tbrp.rp68 (compress= yes);
set table;
run;

/********************/
/* Recensement 1975 */
/********************/
libname rp   'S:\RP\RP 1975\Exploitation complementaire' ;

options ls=80 mprint ;

Data sample;
set 
rp.Gen_a1000752_d5codi01 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi02 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi03 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi04 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi05 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi06 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi07 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi08 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi09 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi10 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi11 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi12 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi13 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi14 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi15 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi16 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi17 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi18 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi19 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi20 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi21 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi22 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi23 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi24 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi25 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi26 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi27 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi28 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi29 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi30 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi31 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi32 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi33 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi34 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi35 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi36 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi37 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi38 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi39 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi40 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi41 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi42 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi43 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi44 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi45 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi46 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi47 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi48 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi49 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi50 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi51 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi52 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi53 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi54 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi55 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi56 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi57 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi58 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi59 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi60 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi61 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi62 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi63 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi64 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi65 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi66 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi67 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi68 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi69 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi70 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi71 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi72 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi73 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi74 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi75 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi76 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi77 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi78 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi79 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi80 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi81 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi82 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi83 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi84 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi85 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi86 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi87 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi88 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi89 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi90 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi91 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi92 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi93 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi94 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)
rp.Gen_a1000752_d5codi95 (keep = S qu AD NC TA DIP sond ae pn rp d cm1 ira c1 aic m cs3 NIM LCM PCF LCF NEF c cil il csd sect14 pr ip aac1)

;
if missing(pn) then delete;
/*********************************************************/
run;

data sample;
length ilot $14;
set sample;
/*************************/
ilot=cats(d,c,cil,il);
run;
data mini.rp75 (compress= yes);
set sample;
y=ranbin(3,1,0.01);
if y=0 then delete;
drop y;
sond=sond*100;
run;

data tbrp.rp75 (compress= yes);
set sample;
run;

/********************/
/* Recensement 1982 */
/********************/
libname rp "S:\RP\RP 1982\Exploitation complementaire - quart\Fichier d�tail au lieu de r�sidence - France m�tropolitaine";

/* select urban ares with more than 50 000 inhabitants
number of urban area: 114 in 1999 */
data sample;
set rp.Gen_a1000822_dcodid01 (keep = aac1 ira etm ae100 mococ moco m s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid02 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid03 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid04 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid05 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid06 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid07 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid08 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid09 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid10 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid11 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid12 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid13 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid14 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid15 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid16 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid17 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid18 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid19 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid2a (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid2b (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid21 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid22 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid23 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid24 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid25 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid26 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid27 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid28 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid29 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid30 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid31 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid32 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid33 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid34 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid35 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid36 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid37 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid38 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid39 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid40 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid41 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid42 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid43 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid44 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid45 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid46 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid47 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid48 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid49 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid50 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid51 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid52 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid53 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid54 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid55 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid56 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid57 (keep = aac1 ira etm ae100 mococ moco m   s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid58 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid59 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid60 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid61 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid62 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid63 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid64 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid65 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid66 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid67 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid68 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid69 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid70 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid71 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid72 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid73 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid74 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid75 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid76 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid77 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid78 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid79 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid80 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid81 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid82 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid83 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid84 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid85 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid86 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid87 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid88 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid89 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid90 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid91 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid92 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid93 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid94 (keep = aac1 ira etm ae100 mococ moco m  s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
rp.Gen_a1000822_dcodid95 (keep = aac1 ira etm ae100 mococ moco m s r cs sond ad ta in pn cm2 sod dip du tu u lprm cs8 d c cil il qu ae15 p ip)
;
if missing(ad) then delete;
run;
data sample;
length ilot $14;
set sample;
/*************************/
ilot=cats(d,c,cil,il);
run;
data mini.rp82 (compress= yes);
set sample;
y=ranbin(3,1,0.01);
if y=0 then delete;
drop y;
sond=sond*100;
run;

data tbrp.rp82 (compress= yes);
set sample;
run;

/********************/
/* Recensement 1990 */
/********************/
libname rp "S:\RP\RP 1990\Exploitation complementaire";
libname rp2 "S:\RP\RP 1990\Exploitation complementaire\region 11";

data sample;
set 
rp2.GEN_A1000902_DNCODD75 (keep = sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
 
rp2.GEN_A1000902_DNCODD77 (keep = sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp2.GEN_A1000902_DNCODD78 (keep = sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp2.GEN_A1000902_DNCODD91 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp2.GEN_A1000902_DNCODD92 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp2.GEN_A1000902_DNCODD93 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp2.GEN_A1000902_DNCODD94 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp2.GEN_A1000902_DNCODD95 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)

rp.GEN_A1000902_DNCODR21 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR22 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR23 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR24 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR25 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR26 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR31 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR41 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR42 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR43 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR52 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR53 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR54 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR72 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR73 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR74 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR82 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR83 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR91 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR93 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)
rp.GEN_A1000902_DNCODR94 (keep =sexe age nat1 tact dipl1 sond inai pnai cil il d C DU90 TU90 U90 cmig cs8 modvie stocd ae100 posp cs matr moco achi iran lprm ae15 prof)

;
if missing(age) then delete;
tu=tu90;

run;

data sample;
length ilot $14;
set sample;
/*************************/
ilot=cats(d,c,cil,il);
run;

data mini.rp90 (compress= yes);
set sample;
y=ranbin(3,1,0.01);
if y=0 then delete;
drop y;
sond=sond*100;
run;

data tbrp.rp90 (compress= yes);
set sample;
run;

/********************/
/* Recensement 1999 */
/********************/
libname rp99 'S:\RP\RP 1999\Exploitation compl�mentaire\Version 1';
option ls=80 mprint;

proc contents data=rp99.tabind991 ;run;

data sample;
set 
rp99.tabind991 
( keep =tact age DU90 TU90 U90 tu99 uu99  iris2000 gq sond c d  CIL 
imm immdo log logdo numf  il fil cs8 aemm nbeta aachi achi moco nafg  posp 
 stocd catl sexe inai2 inat1 lprm pnai3 pnai pnai1 dipl typmc iran arriv naf4  prof )
 rp99.tabind992 
( keep =tact age DU90 TU90 U90 tu99 uu99  iris2000 gq sond c d  CIL 
imm immdo log logdo numf  il fil cs8 aemm nbeta aachi achi moco nafg  posp 
 stocd catl sexe inai2 inat1 lprm pnai3 pnai pnai1 dipl typmc iran arriv naf4  prof )
 rp99.tabind993 
( keep =tact age DU90 TU90 U90 tu99 uu99  iris2000 gq sond c d  CIL 
imm immdo log logdo numf  il fil cs8 aemm nbeta aachi achi moco nafg  posp 
 stocd catl sexe inai2 inat1 lprm pnai3 pnai pnai1 dipl typmc iran arriv naf4  prof )
 rp99.tabind995 
( keep =tact age DU90 TU90 U90 tu99 uu99  iris2000 gq sond c d  CIL 
imm immdo log logdo numf  il fil cs8 aemm nbeta aachi achi moco nafg  posp 
 stocd catl sexe inai2 inat1 lprm pnai3 pnai pnai1 dipl typmc iran arriv naf4  prof )
 rp99.tabind9941
( keep =tact age DU90 TU90 U90 tu99 uu99  iris2000 gq sond c d  CIL 
imm immdo log logdo numf  il fil cs8 aemm nbeta aachi achi moco nafg  posp 
 stocd catl sexe inai2 inat1 lprm pnai3 pnai pnai1 dipl typmc iran arriv naf4  prof )
 rp99.tabind9942
( keep =tact age DU90 TU90 U90 tu99 uu99  iris2000 gq sond c d  CIL 
imm immdo log logdo numf  il fil cs8 aemm nbeta aachi achi moco nafg  posp 
 stocd catl sexe inai2 inat1 lprm pnai3 pnai pnai1 dipl typmc iran arriv naf4  prof )
;
rename tu99=tu;
run;

data mini.rp99 (compress= yes);
set sample;
y=ranbin(3,1,0.01);
if y=0 then delete;
drop y;
sond=sond*100;
run;

data tbrp.rp99 (compress= yes);
set sample;
run;

/********************/
/* Recensement 2007 */
/********************/
libname indiv "S:\RP\RP 2007\Expcomp\din";
libname men "S:\RP\RP 2007\Expcomp\dme";
libname fam "S:\RP\RP 2007\Expcomp\dfa";

/*******************/
/* table individus */
/*******************/
%macro load(table);
data indivf;
set indiv.&table
(keep = 
/* identifiants individuels */
C_IMM C_LOG /*C_IND */ C_ANNEE_COL sexe immi /*inat pnai12*/
/* socio demo carac */
tact dipl agerev NAFG08 POSP moco lprm nafs08
/* csp */
/* probl�mes dans le RP: cs2 not� cs1 ??*/
cs2 cs3 prof
/* arriv�e */
arriv arrivr iran inai
/* location */
/*region_lr */ gq_lr dept_lr commune_lr iris08_lr uu_lr tailleuu99_lr
/* nationalit�s */
nat /*nat13 */ natn /*natn12*/ natc  natnc
/* m�thodo */
c_annee_col ipondi
)
;
ilog=trim(C_IMM)||trim(C_LOG)||trim(C_AnNEE_COL);
run;
%mend;
/*******************
/*******************/
%load(r11a);
data indiv;
set indivf;
run;
%macro loadr(table);
%load(&table);
data indiv;
set indiv indivf;
run;
%mend;
%loadr(r11b);
%loadr(r11c);
%loadr(r21);
%loadr(r22);
%loadr(r23);
%loadr(r24);
%loadr(r25);
%loadr(r26);
%loadr(r31);
%loadr(r41);
%loadr(r42);
%loadr(r43);
%loadr(r52);
%loadr(r53);
%loadr(r54);
%loadr(r72);
%loadr(r73);
%loadr(r74);
%loadr(r82a);
%loadr(r82b);
%loadr(r83);
%loadr(r91);
%loadr(r93);
%loadr(r94);
%macro loadlog(table);
data logf;
set men.&table
(keep = 
/* identifiants */
C_IMM C_LOG C_ANNEE_COL catl /*hlml */ stocd ACHL ACHLR AEMM
)
;
ilog=trim(C_IMM)||trim(C_LOG)||trim(C_AnNEE_COL);
run;
%mend ;
%loadlog(r11);
data log;
set logf;
run;
%macro loadlogf(table);
%loadlog(&table);
data log;
set log logf;
run;
%mend;
%loadlogf(r21);
%loadlogf(r22);
%loadlogf(r23);
%loadlogf(r24);
%loadlogf(r25);
%loadlogf(r26);
%loadlogf(r31);
%loadlogf(r41);
%loadlogf(r42);
%loadlogf(r43);
%loadlogf(r52);
%loadlogf(r53);
%loadlogf(r54);
%loadlogf(r72);
%loadlogf(r73);
%loadlogf(r74);
%loadlogf(r82);
%loadlogf(r83);
%loadlogf(r91);
%loadlogf(r93);
%loadlogf(r94);

%macro loadfam(table);
data famf;
set fam.&table
(keep = 
/* identifiants */
 AU_LR UU_LR TF
C_IMM C_LOG C_ANNEE_COL
)
;
ilog=trim(C_IMM)||trim(C_LOG)||trim(C_AnNEE_COL);
run;
%mend ;
%loadfam(r11);
data fam;
set famf;
run;
%macro loadfamf(table);
%loadfam(&table);
data fam;
set fam famf;
run;
%mend;
%loadfamf(r21);
%loadfamf(r22);
%loadfamf(r23);
%loadfamf(r24);
%loadfamf(r25);
%loadfamf(r26);
%loadfamf(r31);
%loadfamf(r41);
%loadfamf(r42);
%loadfamf(r43);
%loadfamf(r52);
%loadfamf(r53);
%loadfamf(r54);
%loadfamf(r72);
%loadfamf(r73);
%loadfamf(r74);
%loadfamf(r82);
%loadfamf(r83);
%loadfamf(r91);
%loadfamf(r93);
%loadfamf(r94);
proc sort data=indiv;
by ilog;
run;
proc sort data=log;
by ilog;
run;
proc sort data=fam;
by ilog;
run;
/* merge les trois */
data indiv;
merge indiv (in = x) log fam;
by ilog;
if x;
run;

data indiv;
set indiv;
/* seulement les r�sidences principales */
/* = �limine les individus hors logement ordinaire */
if not(catl=1) then delete;
rename ipondi=sond;
rename tailleuu99_lr=tu;
run;

data sample;
set indiv;
run;

data tbrp.rp07 (compress= yes);
set sample;
run;

data mini.rp07 (compress= yes);
set sample;
y=ranbin(3,1,0.01);
if y=0 then delete;
drop y;
sond=sond*100;
run;

/***********/
/* RP 2012 */
/***********/
libname indiv "S:\RP\RP 2012\Exploitation compl�mentaire\Individus";
libname men "S:\RP\RP 2012\Exploitation compl�mentaire\M�nages";
libname fam "S:\RP\RP 2012\Exploitation compl�mentaire\Familles";

/*******************/
/* table individus */
/*******************/
%macro load(table);
data indivf;
set indiv.&table
(keep = 
/* identifiants individuels */
C_IMM C_LOG /*C_IND */ C_ANNEE_COL sexe immi /*inat pnai12*/
/* socio demo carac */
tact dipl agerev NAFG08 POSP moco lprm nafs08
/* csp */
/* probl�mes dans le RP: cs2 not� cs1 ??*/
cs2 cs3 prof
/* arriv�e */
arriv arrivr iran inai
/* location */
/*region_lr */ gq_resid dept_resid commune_resid iris08_resid uu2010_resid  
/* nationalit�s */
nat /*nat13 */ natn /*natn12*/ natc  natnc
/* m�thodo */
c_annee_col ipondi
)
;
ilog=trim(C_IMM)||trim(C_LOG)||trim(C_AnNEE_COL);
run;
%mend;
/*******************
/*******************/
%load(r11);
data indiv;
set indivf;
run;
%macro loadr(table);
%load(&table);
data indiv;
set indiv indivf;
run;
%mend;
%loadr(r21);
%loadr(r22);
%loadr(r23);
%loadr(r24);
%loadr(r25);
%loadr(r26);
%loadr(r31);
%loadr(r41);
%loadr(r42);
%loadr(r43);
%loadr(r52);
%loadr(r53);
%loadr(r54);
%loadr(r72);
%loadr(r73);
%loadr(r74);
%loadr(r82);
%loadr(r83);
%loadr(r91);
%loadr(r93);
%loadr(r94);

%macro loadlog(table);
data logf;
set men.&table
(keep = 
/* identifiants */
C_IMM C_LOG C_ANNEE_COL catl /*hlml */ stocd ACHL AEMM
)
;
ilog=trim(C_IMM)||trim(C_LOG)||trim(C_AnNEE_COL);
run;
%mend ;
%loadlog(r11);
data log;
set logf;
run;
%macro loadlogf(table);
%loadlog(&table);
data log;
set log logf;
run;
%mend;
%loadlogf(r21);
%loadlogf(r22);
%loadlogf(r23);
%loadlogf(r24);
%loadlogf(r25);
%loadlogf(r26);
%loadlogf(r31);
%loadlogf(r41);
%loadlogf(r42);
%loadlogf(r43);
%loadlogf(r52);
%loadlogf(r53);
%loadlogf(r54);
%loadlogf(r72);
%loadlogf(r73);
%loadlogf(r74);
%loadlogf(r82);
%loadlogf(r83);
%loadlogf(r91);
%loadlogf(r93);
%loadlogf(r94);

%macro loadfam(table);
data famf;
set fam.&table
(keep = 
/* identifiants */
 AU2010_RESID UU2010_RESID TF
C_IMM C_LOG C_ANNEE_COL
)
;
ilog=trim(C_IMM)||trim(C_LOG)||trim(C_AnNEE_COL);
run;
%mend ;
%loadfam(r11);
data fam;
set famf;
run;
%macro loadfamf(table);
%loadfam(&table);
data fam;
set fam famf;
run;
%mend;
%loadfamf(r21);
%loadfamf(r22);
%loadfamf(r23);
%loadfamf(r24);
%loadfamf(r25);
%loadfamf(r26);
%loadfamf(r31);
%loadfamf(r41);
%loadfamf(r42);
%loadfamf(r43);
%loadfamf(r52);
%loadfamf(r53);
%loadfamf(r54);
%loadfamf(r72);
%loadfamf(r73);
%loadfamf(r74);
%loadfamf(r82);
%loadfamf(r83);
%loadfamf(r91);
%loadfamf(r93);
%loadfamf(r94);

proc sort data=indiv;
by ilog;
run;
proc sort data=log;
by ilog;
run;
proc sort data=fam;
by ilog;
run;
/* merge les trois */
data indiv;
merge indiv (in = x) log fam;
by ilog;
if x;
run;

data indiv;
set indiv;
/* seulement les r�sidences principales */
/* = �limine les individus hors logement ordinaire */
if not(catl=1) then delete;
rename ipondi=sond;
run;

data sample;
set indiv;
run;

data tbrp.rp12 (compress= yes);
set sample;
run;

data mini.rp12 (compress= yes);
set sample;
y=ranbin(3,1,0.01);
if y=0 then delete;
drop y;
sond=sond*100;
run;
